package main.Q1901_2000;

public class Q1971_1980 {
	public static void main(String[] args) {
		System.out.println("Question1971：");
		System.out.println("Question1972：");
		System.out.println("Question1973：");
		System.out.println("Question1974：使用特殊打字机键入单词的最少时间");
		System.out.println(new Question1974().minTimeToType("bza"));
		System.out.println("Question1975：");
		System.out.println("Question1976：");
		System.out.println("Question1977：");
		System.out.println("Question1978：");
		System.out.println("Question1979：");
		System.out.println("Question1980：");
	}
}

class Question1974 {
	public int minTimeToType(String word) {
		int result = 0;
		char index = 'a';
		for (int i = 0; i < word.length(); i++) {
			char c = word.charAt(i);
			int shun = Math.abs(c - index), ni = 26 - shun;
			result += Math.min(shun, ni);
			result++;
			index = c;
		}
		return result;
	}
}